//
//  HomeTitleButton.swift
//  weibo_swift
//
//  Created by dulinlong on 15/7/1.
//  Copyright © 2015年 sheji_56. All rights reserved.
//

import UIKit

class HomeTitleButton: UIButton {
    
    override init(frame: CGRect) {
        super.init(frame: frame)

        setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(16)
        setTitle(sharedUserAccount?.name, forState: UIControlState.Normal)
        setImage(UIImage(named: "navigationbar_arrow_down"), forState: UIControlState.Normal)
        sizeToFit()
        
    }
    

    required init(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
            titleLabel?.frame.origin.x = 0
            imageView?.frame.origin.x = titleLabel!.bounds.width
       
    }

}
